FROM docker.io/rackspacedot/python37
MAINTAINER xiaobo@yunshicloud.com
LABEL version="1.0" description="这是新闻智能拆条分析服务的任务管理服务"
ENV WORK_HOME /root/newspower
ENV PATH $WORK_HOME/bin:$PATH
RUN mkdir -p "$WORK_HOME"
WORKDIR $WORK_HOME

RUN set -x \
	&& apt update \
	&& apt install -y libgl1-mesa-glx \
	&& apt install -y sshpass

RUN set -x \
	&& pip install DBUtils==1.2 \
	&& pip install torch==1.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html \
	&& pip install torchvision==0.11.2+cpu -f https://download.pytorch.org/whl/torch_stable.html \
	&& pip install opencv-python==4.5.5.64 \
	&& pip install torchsummary==1.5.1 -f https://download.pytorch.org/whl/torch_stable.html

RUN rm /etc/localtime
	
ADD ./localtime /etc
ADD ./task.tar $WORK_HOME
ADD ./libva-drm.so.1.3900.0 /usr/lib/x86_64-linux-gnu
ADD ./libva.so.1.3900.0 /usr/lib/x86_64-linux-gnu
ADD ./libvdpau.so.1.0.0 /usr/lib/x86_64-linux-gnu
ADD ./libva-x11.so.1 /usr/lib/x86_64-linux-gnu
ADD ./qkframe /usr/bin
ADD ./upload.sh /usr/bin
RUN chmod 777 /usr/bin/upload.sh
RUN chmod 777 /usr/bin/qkframe

RUN ldconfig
CMD ["python", "./task/main.py"]
